<?php

if (!defined('BASEPATH'))
    exit('No direct script access allowed');

class Comment extends CI_Controller {
    function __construct() {
        parent::__construct();
        date_default_timezone_set('UTC');
        $this->load->model('manage_comments');
        $this->load->helper('form');
        $this->load->helper('file');
    }
    public function index() {
         
    }
    function postComment(){
        $type = $this->input->get('type');
        $id = $this->input->get('id');
        $comment = $this->input->get('comment');
        $user_id = $this->input->cookie('LEAPSESSID');
        $uploaded_at =  date('F\, l j Y');
        $timestamp = time();
        $insert = $this->manage_comments->addComment($type,$id,$comment,$user_id,$uploaded_at,$timestamp);
        echo json_encode($insert);
    }
}
